package com.iflytek.iot.zookeeper.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author yu 2019/7/9.
 */
@Component
@ConfigurationProperties(prefix = "spring.zookeeper")
public class ZookeeperProperties {

    /**
     * 重试次数
     */
    private int maxRetries;

    /**
     * 重试间隔,单位毫秒
     */
    private int elapsedTime;

    /**
     * 连接地址
     */
    private String connectAddress;

    /**
     * 会话超时时间，单位毫秒
     */
    private int sessionTimeout;

    /**
     * 连接创建超时时间,单位毫秒
     */
    private int connectionTimeout = 2000;


    public int getMaxRetries() {
        return maxRetries;
    }

    public void setMaxRetries(int maxRetries) {
        this.maxRetries = maxRetries;
    }

    public int getElapsedTime() {
        return elapsedTime;
    }

    public void setElapsedTime(int elapsedTime) {
        this.elapsedTime = elapsedTime;
    }

    public String getConnectAddress() {
        return connectAddress;
    }

    public void setConnectAddress(String connectAddress) {
        this.connectAddress = connectAddress;
    }

    public int getSessionTimeout() {
        return sessionTimeout;
    }

    public void setSessionTimeout(int sessionTimeout) {
        this.sessionTimeout = sessionTimeout;
    }

    public int getConnectionTimeout() {
        return connectionTimeout;
    }

    public void setConnectionTimeout(int connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }
}
